<?php
namespace Avalanche;

require_once 'Avalanche/Avalanche.php';
require_once 'ExampleServer.php';

// User system handling
$instance = new \ExampleServer;

// Create server subsystem
$avalanche = new \Avalanche\Avalanche;
$avalanche->init();
$avalanche->setHandleAcceptConnection(array($instance, 'handleAcceptConnection'));
$avalanche->setHandleReadConnection(array($instance, 'handleReadConnection'));
$avalanche->setHandleCloseConnection(array($instance, 'handleCloseConnection'));
$avalanche->serve();
